package com.oocl.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.oocl.dao.CustomerDao;
import com.oocl.pojo.Customer;
import com.oocl.service.CustomerManager;
@Service("manager")
public class CustomerManagerImpl implements CustomerManager {
	private CustomerDao customerDao;
	@Autowired
	public void setCustomerDao(CustomerDao customerDao) {
		this.customerDao = customerDao;
	}

	@Override
	public Customer addCustomer(Customer c) {
		Customer customer = customerDao.addCustomer(c);
		return customer;
	}

	@Override
	public String deleteCustomer(String id) {
		return customerDao.deleteCustomer(id);
	}

	@Override
	public Customer updateCustomer(Customer c) {
		return customerDao.updateCustomer(c);
	}

	@Override
	public List<Customer> findAll() {
		List<Customer> customers = customerDao.findAllCustomer();
		return customers;
	}

	@Override
	public Customer findCustomer(Customer c) {
		return customerDao.findCustomer(c.getId());
	}

}
